<%-- 
    Document   : lesDvd
    Created on : May 26, 2012, 1:02:44 AM
    Author     : Marcouss
--%>

<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!-- Ne pas oublier cette ligne sinon tous les tags de la JSTL seront ignorés ! -->  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
  
<html>
    <head>
        <link rel="stylesheet" type="text/css" media="all" href="style2.css"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Vente de DVD en ligne</title> 
    </head>
    
    <body>
        <div id="Global">
            <jsp:include page="header.jsp" />
            <div id="body">
                <jsp:include page="leftBar.jsp"/>
                
            <div id="centerBody">
                <h5>Les Dvds</h5>
                <form action="ServletDvd" method="get"> 
                        <input type="hidden" name="action" value="addDvd"/>  
                        <input type="submit" value="Add" name="submit"/>
                </form>
                <c:forEach var="d" items="${requestScope['listeDvd']}">
                    <form action="ServletPanier" method="get"> 
                    <div id="dvd">
                        <img id="dvdimg" src=${d.photo} /> 
                        <p>Titre du film : ${d.titre}</p> 
                        <p>Réalisateurs :<ul>
                        <c:forEach var="r" items="${d.listRealisateur}">
                            <li>${r.prenom} ${r.nom}</li> <!-- {}-->
                        </c:forEach></ul></p>
                        <p>Acteurs :<ul>
                        <c:forEach var="a" items="${d.listActeur}">
                            <li>${a.prenom} ${a.nom}</li> <!-- {}-->
                        </c:forEach></ul> </p>
                        <p>Année : ${d.annee}</p>
                        <p>Genre : ${d.genre}</p>
                        <p>Description : ${d.description}</p>
                        <p>Prix : ${d.prix} €</p> 
                        <input type="hidden" name="price" value="${d.prix}"/>
                        
                        <input type="hidden" name="action" value="buyDvd"/>  
                        <input type="submit" value="Add to Cart" name="submit"/> 
                        <input type="hidden" name="idDvd" value=${d.id} /> <!--d.idDvd --> 
                    </div>
                    </form>
               </c:forEach>
                
                <c:if test="NotFound"><p>Votre requete de recherche n'a donné aucun résultat !</p></c:if>
                
                <table>
                <tr>
                    <td>
                 <c:if test="${!hidePrev}">
                    <form action="ServletDvd" method="get">
                        <input type="hidden" value="PrevPage" name="action" />
                        <input type="submit" value="Previous"  />
                    </form>
                 </c:if>
                  </td>
                   <td align="left "><b>
                       <% String pageNum =  (String) session.getAttribute("page");
                          String pageTotal =  (String) session.getAttribute("pageTot"); 
                          out.println(pageNum +"/"+ pageTotal);%></b>
                   </td>
                   <td>
                      <c:if test="${!hideNext}">
                          <form action="ServletDvd" method="get">
                            <input type="hidden" value="NextPage" name="action" />
                            <input type="submit" value="Next"  />
                          </form>
                      </c:if>
                       </td>
                      </tr>
                </table>
            </div>
            <jsp:include page="rightBar.jsp" />
            
            </div>
          <jsp:include page="footer.jsp" />
         
          